<?php
class ModelFactory
{
    Static $all_model = array();
    Static function M($model_name)
    {
        if(isset(static::$all_model[$model_name])||!(static::$all_model[$model_name] instanceof $model_name))
        {
            static::$all_model[$model_name] = new $model_name();
        }
        return static::$all_model[$model_name];
    }
}